home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DDJ0992.ARJ / NOTES.ASC < prev    next >
Text File  |  1992-08-10  |  3KB  |  57 lines

  1.  
  2.  
  3. Timer module
  4. During the initial debug phase, we recorded the task response 
  5. time in the producer module. We moved this operation into 
  6. wait_for_interrupt() in timer.c (see Listing 2). The first  ioctl 
  7. calls timer_wait_for_int() in the driver with the address of 
  8. structure m. The interrupt response time (IRT)  and interrupt 
  9. service time (IST) are recorded in this structure by the driver. 
  10. Then it does a second ioctl which reads the timer value only. 
  11. This number is the task response time (TRT).  Note that all these 
  12. measured times have the inherent overhead of the execution time 
  13. for the "read timer" code. 
  14.  
  15. Driver
  16. dcc20a module
  17. The most relevant functions are the timer_interrupt() and 
  18. timer_ioctl() funtions.
  19.  
  20. Timer_interrupt()
  21. We sent the command to the timer board to save the current value 
  22. of Timer 1 in the hold register. Then we checked to see if anyone 
  23. was waiting for this interrupt by checking interrupt_sem. If 
  24. count of the semaphore is less than zero, then somebody is 
  25. waiting for itDwhich implies that we met our TCT deadline. We 
  26. signal the semaphore to wake up the producer task. Then we save 
  27. the value stored in the hold register earlierDthis is the 
  28. interrupt response time (IRT). Then we read the next value in the 
  29. hold register and save it into the ist_delta variable. These are 
  30. all snapshot times that we are reading and saving to be 
  31. interpreted and converted into the IRT and IST periods. If 
  32. interrupt_sem is not less than zero, then TCT was violated so we 
  33. increment the overrun counter. Again we are not measuring the 
  34. true interrupt service timeDwe are measuring the time minus a 
  35. constant. However, this time is still quite accurate because the 
  36. bulk of the time here is spent in ssignal() where we make the 
  37. producer (which was blocked) runnable.
  38.  
  39. timer_ioctl()
  40. case TIMER_WAIT_FOR_INT:
  41. Essentially as long we do the swait() call  before the next 
  42. interrupt comes in, we do not get an overrun. If we do the 
  43. swait() after the interrupt comes in, then we are going to get an 
  44. overrun which is detected in the timer_interrupt() routine. Then 
  45. we copy the drt and ist_delta into a structure that the 
  46. application passes.The interrupts are disabled here so if we 
  47. overrun our data integrity is maintained.
  48.  
  49. Display module
  50. This module was modified but the basic structure is identical to 
  51. the skeleton we built. We created a double buffering scheme to 
  52. keep a running minimum and maximum for all the different response 
  53. times. We compute how many times to run through the double 
  54. buffers before printing the data to the screen. The printing is 
  55. done by another thread spun off by the display thread. 
  56.  
  57.